<?
include_once "gblinclude.lib";
include_once "objinfo.lib";

$ids = $_GET["ids"];
$objName = $_GET["obj_name"];

$objInfo = CObjInfo::GetInstance();

$objDescFilePath = $objInfo->objInfos[$objName]->objDescFilePath;
$objDescClassName = $objInfo->objInfos[$objName]->objDescClass;

include_once "..".$objDescFilePath;
$objDesc = new $objDescClassName();
$titleColumn = $objDesc->attrs[$objDesc->titleAttrName]->columnName;
$persistFactory = CPersistFactory::getInstance();

$res = array();

$idArr = explode(";", $ids);
$tmpChkArr = array();
foreach($idArr as $id)
{
	if (in_array($tmpChkArr, $id) || IsEmptyString($id))
		continue;
	$tmpChkArr[] = $id;
	$dataObj = $persistFactory->getDataObject($id, $objDesc, $titleColumn);
	$res[] = array($id, mb_convert_encoding($dataObj->$titleColumn,"UTF-8","GB2312"));	
}

echo json_encode($res);
?>
